package com.blog.service.Impl;
import com.blog.Utils.DataUtil;
import com.blog.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;

/**
 * @author 任浩
 * @version 1.0
 */
@Service
public class DataServiceImpl implements DataService {

//    @Autowired
//    private DataUtil dataUtil;

    /**
     * 得到当前网站的独立访问用户
     * @param start
     * @param end
     * @return
     */
    @Override
    public Long getUV(LocalDateTime start, LocalDateTime end) {
        DataUtil dataUtil = new DataUtil();
        Long uvCount = dataUtil.getUvCount(start, end);
        return uvCount;
    }

    /**
     * 得到当前网站的日访问用户
     * @param start
     * @param end
     * @return
     */
    @Override
    public Long getDAU(LocalDateTime start, LocalDateTime end) {
        DataUtil dataUtil = new DataUtil();
        Long dauCount = dataUtil.getDauCount(start, end);
        return dauCount;
    }
}
